<template>
  <f-table-follow
    overlayClassName="ignore-cell-click"
    class="h350"
    :columns="columns"
    :query="query"
    @change="handleChange">
    <f-input placeholder="请选择产品" v-model:value="input"></f-input>
  </f-table-follow>
</template>

<script setup lang="ts">
import { ref, watch } from 'vue';
const emits = defineEmits(['update:value', 'select', 'change']);
const props = defineProps<{
  itemField?: string;
  value?: string | object;
  disabled?: boolean;
  placeholder?: string;
}>();

const input = ref(props.value);
const columns = ref([
  { title: '产品编码', field: 'code', width: 200 },
  { title: '产品编码', field: 'name', width: 200 },
  { title: '规格', field: 'spec', width: 200 },
  { title: '生产厂商', field: 'producer', width: 200 }
]);
function query(send) {
  return Promise.resolve({
    code: 0,
    data: [
      {
        productId: '1763042153110265856',
        spuId: '202400002',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '2024000002',
        name: '哌拉西林',
        englishName: 'Piperacillin',
        spec: '1g',
        doseType: '注射用无菌粉末',
        model: null,
        producerId: '1792892189285396480',
        producer: '哈药集团',
        isSerial: true,
        encodingType: {
          code: '1',
          desc: '厂家赋码'
        },
        unit: 1,
        unitName: '支',
        billUnit: 10,
        unitId: '1158381',
        unitComment: '10支=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157400',
            unit: 1,
            name: '支',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158381',
            unit: 10,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: false,
        isDismount: false,
        isBatch: true,
        expireMonth: 36,
        isTaxInvoice: true,
        taxRate: '0.1',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '1425',
        spuId: '202400010',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z000600',
        name: '醒脑静注射液',
        englishName: 'ENGLISH_NAME',
        spec: '10ml*2支/盒',
        doseType: '注射液',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '支',
        billUnit: 2,
        unitId: '1159138',
        unitComment: '2支=1盒 ',
        unitPackVOS: [
          {
            unitId: '1158157',
            unit: 1,
            name: '支',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1159138',
            unit: 2,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: false,
        isDismount: false,
        isBatch: true,
        expireMonth: 6,
        isTaxInvoice: true,
        taxRate: '0.1',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '1465',
        spuId: '202400024',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: 'Z0000380',
        name: 'N注射用头孢他啶',
        englishName: 'Ceftazidime',
        spec: '1.0g/支',
        doseType: '注射用无菌粉末',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '支',
        billUnit: 10,
        unitId: '1159170',
        unitComment: '10支=1盒 ',
        unitPackVOS: [
          {
            unitId: '1158189',
            unit: 1,
            name: '支',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1159170',
            unit: 10,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: false,
        isDismount: false,
        isBatch: true,
        expireMonth: 4,
        isTaxInvoice: false,
        taxRate: null,
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '689',
        spuId: '202400057',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z99229',
        name: 'D2(基)阿奇霉素片',
        englishName: 'Azithromycin',
        spec: '0.25g*6片/盒',
        doseType: '片剂',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 6,
        unitId: '1158944',
        unitComment: '6片=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157963',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158944',
            unit: 6,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 12,
        isTaxInvoice: true,
        taxRate: '0.13',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '695',
        spuId: '202400059',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z98809',
        name: '(基)阿奇霉素肠溶胶囊(微丸)',
        englishName: 'Azithromycin',
        spec: '0.25g(25万单位)*6粒/盒',
        doseType: '肠溶片',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '粒',
        billUnit: 6,
        unitId: '1158948',
        unitComment: '6粒=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157967',
            unit: 1,
            name: '粒',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158948',
            unit: 6,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 12,
        isTaxInvoice: true,
        taxRate: '0.13',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '699',
        spuId: '202400080',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z987478',
        name: '(基)盐酸左氧氟沙星胶囊',
        englishName: 'EnglishName',
        spec: '0.2g*12粒/盒',
        doseType: '胶囊剂',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '粒',
        billUnit: 12,
        unitId: '1158951',
        unitComment: '12粒=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157970',
            unit: 1,
            name: '粒',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158951',
            unit: 12,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 5,
        isTaxInvoice: true,
        taxRate: '0.4',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '1806158701790097408',
        spuId: '202400127',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: 'CPBM2024060000000239',
        name: '甲硝唑',
        englishName: 'Metronidazole',
        spec: '111',
        doseType: '片剂',
        model: null,
        producerId: '1790220409789788160',
        producer: '入库测试供应商05',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '粒',
        billUnit: 100,
        unitId: '1806158701903343616',
        unitComment: '100粒=1瓶 ',
        unitPackVOS: [
          {
            unitId: '1806158701894955008',
            unit: 1,
            name: '粒',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1806158701903343616',
            unit: 100,
            name: '瓶',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: false,
        isDismount: false,
        isBatch: true,
        expireMonth: 24,
        isTaxInvoice: true,
        taxRate: '0.03',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '760',
        spuId: '202400132',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007P001223',
        name: '(基)阿苯达唑片',
        englishName: 'Albendazole',
        spec: '0.2g*10片/盒',
        doseType: '片剂',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 10,
        unitId: '1159009',
        unitComment: '10片=1瓶 ',
        unitPackVOS: [
          {
            unitId: '1158028',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1159009',
            unit: 10,
            name: '瓶',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 12,
        isTaxInvoice: true,
        taxRate: '0.11',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '765',
        spuId: '202400143',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007P001761',
        name: '(基)吸入用七氟烷',
        englishName: 'EnglishName',
        spec: '120ml/瓶',
        doseType: '吸入气雾剂',
        model: null,
        producerId: '1793472734759239680',
        producer: '湖南方盛制药股份有限公司',
        isSerial: true,
        encodingType: {
          code: '1',
          desc: '厂家赋码'
        },
        unit: 1,
        unitName: '瓶',
        billUnit: 1,
        unitId: '1159014',
        unitComment: '1=1瓶 ',
        unitPackVOS: [
          {
            unitId: '1159014',
            unit: 1,
            name: '瓶',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          },
          {
            unitId: '1158033',
            unit: 1,
            name: '瓶',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 3,
        isTaxInvoice: true,
        taxRate: '0.15',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '773',
        spuId: '202400265',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z99044',
        name: '(基)硝酸异山梨酯片',
        englishName: 'Isosorbide Dinitrate',
        spec: '5mg*100片/瓶',
        doseType: '片剂',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 100,
        unitId: '1159022',
        unitComment: '100片=1瓶 ',
        unitPackVOS: [
          {
            unitId: '1158041',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1159022',
            unit: 100,
            name: '瓶',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 3,
        isTaxInvoice: true,
        taxRate: '0.1',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '283',
        spuId: '202400449',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007P001267',
        name: '(基)地塞米松磷酸钠注射液',
        englishName: 'Dexamethasone',
        spec: '5mg:1ml*10支/盒',
        doseType: '注射用无菌粉末',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '支',
        billUnit: 10,
        unitId: '1158552',
        unitComment: '10支=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157571',
            unit: 1,
            name: '支',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158552',
            unit: 10,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 6,
        isTaxInvoice: true,
        taxRate: '0.25',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '325',
        spuId: '202400452',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: 'Z0000384',
        name: '盐酸二甲双胍片(格华止)',
        englishName: 'Metformin',
        spec: '0.85g*30片/盒',
        doseType: '片剂',
        model: null,
        producerId: '1802548080477556736',
        producer: '杭州中美华东制药有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 30,
        unitId: '1158594',
        unitComment: '30片=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157613',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158594',
            unit: 30,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: false,
        isDismount: false,
        isBatch: true,
        expireMonth: 48,
        isTaxInvoice: true,
        taxRate: '0.13',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '406',
        spuId: '202400452',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: 'Z0000296',
        name: '吡格列酮二甲双胍片',
        englishName: 'Metformin',
        spec: '15mg/500mg*30片/盒',
        doseType: '片剂',
        model: null,
        producerId: '1802548080477556736',
        producer: '杭州中美华东制药有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 30,
        unitId: '1158675',
        unitComment: '30片=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157694',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158675',
            unit: 30,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: false,
        isDismount: false,
        isBatch: true,
        expireMonth: 48,
        isTaxInvoice: true,
        taxRate: '0.13',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '481',
        spuId: '202400452',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z001847',
        name: '盐酸二甲双胍片(格华止)',
        englishName: 'Metformin',
        spec: '850mg*20片/盒',
        doseType: '片剂',
        model: null,
        producerId: '1802548080477556736',
        producer: '杭州中美华东制药有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 20,
        unitId: '1158775',
        unitComment: '20片=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157794',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158775',
            unit: 20,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: false,
        isDismount: false,
        isBatch: true,
        expireMonth: 48,
        isTaxInvoice: true,
        taxRate: '0.13',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '839',
        spuId: '202400453',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z001826',
        name: '(基)盐酸二甲双胍肠溶片',
        englishName: 'Metformin',
        spec: '0.25*100片/瓶',
        doseType: '肠溶片',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 100,
        unitId: '1159088',
        unitComment: '100片=1瓶 ',
        unitPackVOS: [
          {
            unitId: '1158107',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1159088',
            unit: 100,
            name: '瓶',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 24,
        isTaxInvoice: true,
        taxRate: '0.13',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '294',
        spuId: '202400455',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007P001290',
        name: '(基)盐酸二甲双胍缓释片',
        englishName: 'Metformin',
        spec: '0.5g*30片/盒',
        doseType: '缓释片',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 30,
        unitId: '1158563',
        unitComment: '30片=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157582',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158563',
            unit: 30,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 48,
        isTaxInvoice: true,
        taxRate: '0.13',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '238',
        spuId: '202400461',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z001915',
        name: '(基)格列美脲片',
        englishName: 'Glimepiride',
        spec: '2mg*15片/盒',
        doseType: '片剂',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 15,
        unitId: '1158402',
        unitComment: '15片=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157421',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158402',
            unit: 15,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 24,
        isTaxInvoice: false,
        taxRate: '0',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '252',
        spuId: '202400463',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007P001292',
        name: '(基)阿卡波糖片',
        englishName: 'Acarbose',
        spec: '50mg*30片/盒',
        doseType: '片剂',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        unit: 1,
        unitName: '片',
        billUnit: 30,
        unitId: '1158523',
        unitComment: '30片=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157542',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158523',
            unit: 30,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 24,
        isTaxInvoice: true,
        taxRate: '0.13',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '542',
        spuId: '202400515',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z987858',
        name: '回生口服液',
        englishName: 'ENGLISH_NAME',
        spec: '10ml*10支/盒',
        doseType: '口服膜剂',
        model: null,
        producerId: '1792892189285396480',
        producer: '哈药集团',
        isSerial: true,
        encodingType: {
          code: '2',
          desc: '院内赋码'
        },
        unit: 1,
        unitName: '支',
        billUnit: 10,
        unitId: '1158833',
        unitComment: '10支=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157852',
            unit: 1,
            name: '支',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158833',
            unit: 10,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: true,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: false,
        isDismount: false,
        isBatch: true,
        expireMonth: 9,
        isTaxInvoice: true,
        taxRate: '0.1',
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      },
      {
        productId: '213',
        spuId: '202400794',
        materialType: {
          code: '01',
          desc: '药品'
        },
        code: '007Z9887824',
        name: 'Dz(基)金水宝片',
        englishName: 'ENGLISH_NAME',
        spec: '0.42g*24片/盒',
        doseType: '片剂',
        model: null,
        producerId: '1746703246613666666',
        producer: '西藏阜康医疗股份有限公司',
        isSerial: false,
        encodingType: null,
        serialNo: [],
        unit: 1,
        unitName: '片',
        billUnit: 24,
        unitId: '1158375',
        unitComment: '24片=1盒 ',
        unitPackVOS: [
          {
            unitId: '1157394',
            unit: 1,
            name: '片',
            isMinUnit: true,
            isMinPack: false,
            isDoseUnit: null
          },
          {
            unitId: '1158375',
            unit: 24,
            name: '盒',
            isMinUnit: false,
            isMinPack: true,
            isDoseUnit: null
          }
        ],
        isSpecialControl: false,
        isColdChain: false,
        isExpire: true,
        isCannabisDrug: false,
        isBase: true,
        isDismount: false,
        isBatch: true,
        expireMonth: 36,
        isTaxInvoice: false,
        taxRate: null,
        qty: null,
        taxPrice: null,
        totalPriceTax: null,
        price: null,
        additionRatio: null,
        amount: null
      }
    ],
    msg: '操作成功',
    path: null,
    extra: null,
    timestamp: '1723686398922',
    errorMsg: '',
    pageInfo: {
      page: '1',
      lastPage: 1,
      total: '20',
      size: '20'
    },
    isSuccess: true
  });
}

function handleChange(row) {
  emits('select', { row, opType: props.opType });
  input.value = row.code;
}

watch(
  () => props.value,
  (value) => {
    input.value = value;
  }
);

watch(input, (v) => {
  input.value = v;
  emits('update:value', v);
});
</script>
